package core;

import java.sql.Connection;
import java.util.List;
import java.util.Map;

import net.sf.json.JSONObject;

public  class CoreDaoInvoke extends CoreDao{
  /**
   * 单例模式
   */
  private static CoreDaoInvoke dao = new CoreDaoInvoke();
  public CoreDaoInvoke(){}
  public static CoreDaoInvoke getInstance() {
    return dao;
  }
  
  @Override
  public  List<Map<String,Object>> invoke(Connection con,String methodKey) throws Exception {
     return getResultList(con, methodKey, null );
  }

  @Override
  public  List<Map<String,Object>> invoke(Connection con, String methodKey, Object... paramMap) throws Exception {
    return getResultList(con, methodKey, paramMap );
  }
  
  public List<Map<String,Object>> invokeSql( Connection con, String sql, Object... paramMap ) throws Exception{
    return getResultListSql( con, sql, paramMap );
  }
  
  @Override
  public List<JSONObject> invokeJson(Connection con, String methodKey, Object... param) throws Exception {
    return getResultJsons(con, methodKey, param);
  }
  
  @Override
  public List<JSONObject> invokeJsonSql(Connection con, String sql, Object... params) throws Exception {
    return getResultJsonsSql(con, sql, params);
  }
}
